from django.db import models
from rest_framework.pagination import LimitOffsetPagination


# Create your models here.
class HotelCodeCity(models.Model):
    province_code = models.CharField(db_column='Province_code', max_length=255, blank=True,
                                     null=True)  # Field name made lowercase.
    province_name = models.CharField(db_column='Province_name', max_length=255, blank=True,
                                     null=True)  # Field name made lowercase.
    city_code = models.CharField(max_length=255, blank=True, null=True)
    city_name = models.CharField(max_length=255, blank=True, null=True)
    area_code = models.CharField(max_length=255, blank=True, null=True)
    area_name = models.CharField(max_length=255, blank=True, null=True)

    class Meta:
        managed = False
        db_table = 'hotel_code_city'


class HotelIdBind(models.Model):
    xc_hotel_id = models.CharField(max_length=255, blank=True, null=True, verbose_name='携程id')
    xc_hotel_name = models.CharField(max_length=255, blank=True, null=True, verbose_name='携程名称')
    fz_hotel_id = models.CharField(max_length=255, blank=True, null=True, verbose_name='飞猪id')
    fz_hotle_name = models.CharField(max_length=255, blank=True, null=True, verbose_name='飞猪名称')

    class Meta:
        managed = False
        db_table = 'hotel_id_bind'
        verbose_name = '平台酒店绑定'
        verbose_name_plural = verbose_name


class HotelRedCity(models.Model):
    name = models.CharField(max_length=55, blank=True, null=True)
    shid = models.CharField(max_length=55, blank=True, null=True)
    url = models.CharField(max_length=1000, blank=True, null=True)
    red = models.CharField(max_length=255, blank=True, null=True)
    data_time = models.CharField(max_length=255, blank=True, null=True)
    city = models.CharField(max_length=255, blank=True, null=True)
    address = models.CharField(max_length=255, blank=True, null=True)
    lat = models.CharField(max_length=255, blank=True, null=True)
    lng = models.CharField(max_length=255, blank=True, null=True)

    class Meta:
        managed = False
        db_table = 'hotel_red_city'


class HotelRedGround(models.Model):
    hotel_id = models.CharField(max_length=255, blank=True, null=True)
    name = models.CharField(max_length=255, blank=True, null=True)
    path = models.CharField(max_length=255, blank=True, null=True)
    lng = models.CharField(max_length=255, blank=True, null=True)
    lat = models.CharField(max_length=255, blank=True, null=True)
    city_code = models.CharField(max_length=255, blank=True, null=True)
    other = models.CharField(max_length=255, blank=True, null=True)

    class Meta:
        managed = False
        db_table = 'hotel_red_ground'


class StandardResultSetPagination(LimitOffsetPagination):
    # 默认每页显示的条数
    default_limit = 20
    # url 中传入的显示数据条数的参数
    limit_query_param = 'limit'
    # url中传入的数据位置的参数
    offset_query_param = 'offset'
    # 最大每页显示条数
    max_limit = None


class StandardMaxResultSetPagination(LimitOffsetPagination):
    # 默认每页显示的条数
    default_limit = 100000000
    # url 中传入的显示数据条数的参数
    limit_query_param = 'limit'
    # url中传入的数据位置的参数
    offset_query_param = 'offset'
    # 最大每页显示条数
    max_limit = None


class HotelItemXx(models.Model):
    shid = models.CharField(max_length=255, blank=True, null=True)
    srtid = models.CharField(max_length=255, blank=True, null=True)
    item_id = models.CharField(max_length=255, blank=True, null=True)
    rate_id = models.CharField(max_length=255, blank=True, null=True)
    sellernick = models.CharField(db_column='sellerNick', max_length=255, blank=True,
                                  null=True)  # Field name made lowercase.
    rtname = models.CharField(db_column='rtName', max_length=255, blank=True, null=True)  # Field name made lowercase.
    zhengce = models.CharField(max_length=255, blank=True, null=True)
    price = models.CharField(max_length=255, blank=True, null=True)
    page = models.CharField(max_length=255, blank=True, null=True)
    create_time = models.DateTimeField()
    update_time = models.DateTimeField()

    class Meta:
        managed = False
        db_table = 'hotel_item_xx'
        verbose_name = '展示监控'
        verbose_name_plural = verbose_name


class HotelStaPp(models.Model):
    item_id = models.CharField(max_length=255, blank=True, null=True)
    hotel_name = models.CharField(max_length=100, blank=True, null=True)
    hotel_path = models.CharField(max_length=255, blank=True, null=True)
    check_in = models.CharField(max_length=55, blank=True, null=True)
    check_out = models.CharField(max_length=55, blank=True, null=True)
    room_name = models.CharField(max_length=100, blank=True, null=True)
    room_price = models.CharField(max_length=100, blank=True, null=True)
    room_price_pp = models.CharField(max_length=100, blank=True, null=True)
    bed_type = models.CharField(max_length=55, blank=True, null=True)
    floor = models.CharField(max_length=55, blank=True, null=True)
    breakfast = models.CharField(max_length=55, blank=True, null=True)
    bed_ug = models.CharField(max_length=55, blank=True, null=True)
    floor_space = models.CharField(max_length=55, blank=True, null=True)
    windows = models.CharField(max_length=55, blank=True, null=True)
    lat = models.CharField(max_length=255, blank=True, null=True)
    lng = models.CharField(max_length=255, blank=True, null=True)
    sales = models.CharField(max_length=55, blank=True, null=True)
    data_time = models.CharField(max_length=255, blank=True, null=True)
    city = models.CharField(max_length=255, blank=True, null=True)

    class Meta:
        managed = False
        db_table = 'hotel_sta_pp'


class HotelStaPpCopy1(models.Model):
    item_id = models.CharField(max_length=255, blank=True, null=True)
    hotel_name = models.CharField(max_length=100, blank=True, null=True)
    hotel_path = models.CharField(max_length=255, blank=True, null=True)
    check_in = models.CharField(max_length=55, blank=True, null=True)
    check_out = models.CharField(max_length=55, blank=True, null=True)
    room_name = models.CharField(max_length=100, blank=True, null=True)
    room_price = models.CharField(max_length=100, blank=True, null=True)
    room_price_pp = models.CharField(max_length=100, blank=True, null=True)
    bed_type = models.CharField(max_length=55, blank=True, null=True)
    floor = models.CharField(max_length=55, blank=True, null=True)
    breakfast = models.CharField(max_length=55, blank=True, null=True)
    bed_ug = models.CharField(max_length=55, blank=True, null=True)
    floor_space = models.CharField(max_length=55, blank=True, null=True)
    windows = models.CharField(max_length=55, blank=True, null=True)
    lat = models.CharField(max_length=255, blank=True, null=True)
    lng = models.CharField(max_length=255, blank=True, null=True)
    sales = models.CharField(max_length=55, blank=True, null=True)
    data_time = models.CharField(max_length=255, blank=True, null=True)
    city = models.CharField(max_length=255, blank=True, null=True)

    class Meta:
        managed = False
        db_table = 'hotel_sta_pp_copy1'


class HotelStar(models.Model):
    hotel_id = models.CharField(max_length=255, blank=True, null=True)
    name = models.CharField(max_length=255, blank=True, null=True)
    path = models.CharField(max_length=255, blank=True, null=True)
    url = models.CharField(max_length=1000, blank=True, null=True)
    star_rated = models.CharField(max_length=255, blank=True, null=True)
    phone = models.CharField(max_length=255, blank=True, null=True)
    other = models.CharField(max_length=255, blank=True, null=True)

    class Meta:
        managed = False
        db_table = 'hotel_star'


class HotelXcList(models.Model):
    hotel_id = models.CharField(max_length=255, blank=True, null=True)
    hotel_name = models.CharField(max_length=255, blank=True, null=True)
    hotel_path = models.CharField(max_length=255, blank=True, null=True)

    class Meta:
        managed = False
        db_table = 'hotel_xc_list'


class HotelItemPrice(models.Model):
    shid = models.CharField(max_length=255, blank=True, null=True, verbose_name='酒店ID')
    srtid = models.CharField(max_length=255, blank=True, null=True, verbose_name='房型ID')
    item_id = models.CharField(max_length=255, blank=True, null=True, verbose_name='商品编号ID')
    rate_id = models.CharField(max_length=255, blank=True, null=True, verbose_name='价格编号ID')
    sellernick = models.CharField(db_column='sellerNick', max_length=255, blank=True,
                                  null=True, verbose_name='同行店铺')  # Field name made lowercase.
    rtname = models.CharField(db_column='rtName', max_length=255, blank=True, null=True)  # Field name made lowercase.
    zhengce = models.CharField(max_length=255, blank=True, null=True)
    price = models.CharField(max_length=255, blank=True, null=True)
    create_time = models.DateTimeField(verbose_name='创建时间')
    update_time = models.DateTimeField(verbose_name='更新时间')

    class Meta:
        managed = False
        db_table = 'hotel_item_price'
        verbose_name = '同行名单'
        verbose_name_plural = verbose_name


class HotelWhitePrice(models.Model):
    shid = models.CharField(max_length=255, blank=True, null=True, verbose_name='酒店ID', help_text='飞猪酒店ID')
    srtid = models.CharField(max_length=255, blank=True, null=True, verbose_name='房型ID')
    zhengce = models.CharField(max_length=255, blank=True, null=True, verbose_name='早餐政策')
    itemid = models.CharField(max_length=255, blank=True, null=True, verbose_name='商品编号ID')
    price = models.CharField(max_length=255, blank=True, null=True, verbose_name='价格')
    create_time = models.DateTimeField(verbose_name='创建时间')
    update_time = models.DateTimeField(verbose_name='更新时间')

    class Meta:
        managed = False
        db_table = 'hotel_white_price'
        verbose_name = '白名单'
        verbose_name_plural = verbose_name


class HotelStatu(models.Model):
    OPEN_STATU = (
        ('0', '关闭'),
        ('1', '开启'),
    )
    name = models.CharField(max_length=255)
    shirt_size = models.CharField(max_length=2, choices=OPEN_STATU)
    create_time = models.DateTimeField()

    class Meta:
        db_table = 'hotel_statu'
        verbose_name = '店铺状态'
        verbose_name_plural = verbose_name


class HotelXcId(models.Model):
    name = models.CharField(max_length=255, blank=True, null=True)
    hotel_id = models.CharField(max_length=255, blank=True, null=True)

    class Meta:
        managed = False
        db_table = 'hotel_xc_id'
        verbose_name = '超能海豹销量名单'
        verbose_name_plural = verbose_name
